
#ifndef CLIENTMOON_H
#define CLIENTMOON_H

#include <cstdlib>
#include <string>
#include "ResearchTask.h"
#include "ProductionTask.h"
#include "Missile.h"
#include "Shield.h"
#include <vector>
using namespace std;

class ClientMoon {
	public:

		void init(vector<string> initVector);
		ClientMoon(int pmoonId, vector<string> initVector);
		int getPlayerId(){return playerId;}
		void setPlayerId(int pPlayerId){playerId = pPlayerId;}
		int getMoonId(){return moonId;}
		//getters and setters
		int getPopulation(){return population;}
		void setPopulation(int pPopulation){population = pPopulation;}
		//get the name of the current task, for display
		string getCurrentProductionTaskName(){return currentProductionTaskName;}
		string getCurrentResearchTaskName(){return currentResearchTaskName;}
		//returns the progress of the tasks 0-100, -1 if no task
		int getBuildProgress(){return buildProgress;}
		int getResearchProgress(){return researchProgress;}

		//population allocation methods
		int getReproduction(){return reproduction;}
		int getProduction(){return production;}
		int getResearch(){return research;}
		int getMissileResearchLevel(){return missileResearchLevel;}
		int getShieldResearchLevel(){return shieldResearchLevel;}




		//comm requests now
		void startBuild(int task, int level);
		void startResearch(int task, int level);
		//doesnt do a comm request, calls allocatePopulation to do it
		void setReproduction(int pReproduction);
		void setProduction(int pProduction);
		void setResearch(int pResearch);

		Missile * getReadyMissile();
		Shield * getReadyShield();


	private:
		//this does a comm request
		void allocatePopulation(int pReproduction, int pResearch, int pProduction);

		//planet attributes
		int moonId;
		double population;
		int playerId;

		//how much time is left for the tasks to finish
		string currentResearchTaskName;
		int researchProgress;
		string currentProductionTaskName;
		int buildProgress;
		//the missile that is ready to fire
		Missile * readyMissile;
		
		//the shield protecting the planet
		Shield * readyShield;

		//research levels, start at 1
		int missileResearchLevel;
		int shieldResearchLevel;

		//population allocations - add up to 100
		int reproduction;
		int production;
		int research;
};

#endif